package com.yang.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class MapAction
 */
@WebServlet("/map")
public class MapAction extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public MapAction() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		/*String jsapi_ticket = TokenProxy.jsApiTicket();
		String url = "http://yang.ngrok.cc/weixin/index";
		Map<String, String> ret = Sign.sign(jsapi_ticket, url);
		request.setAttribute("signature", ret.get("signature"));
		request.setAttribute("nonceStr", ret.get("nonceStr"));
		request.setAttribute("timestamp", ret.get("timestamp"));
		request.setAttribute("appId",Config.instance().getAppid());*/
		request.getRequestDispatcher("/page/map.jsp").forward(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
